/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Dimensions,
    Platform,
    Image,
    ScrollView,
    TouchableOpacity,
    Animated,
    Easing,
    ListView,
    RefreshControl
} from 'react-native';

var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;
import Global from "../Commom/GlobalConst";
import ShowView from '../Components/ShowView';
import WithTogether from "../Pages/WithTogetherDetails";
import HelpToBuyDetails from "../Pages/HelpToBuyDetails";
import QuestionDetailsPage from "../Pages/QuestionDetailsPage";
import TravelsDetails from "../Pages/TravelsDetails";

import InitiatedTravels from '../Pages/InitiatedTravels';
import InitiatedQuestion from '../Pages/InitiatedQuestion';
import InitiatedWithTour from '../Pages/InitiatedWithTour';
import InitiatedHelpToBuy from '../Pages/InitiatedHelpToBuy';
import ListHelpToBuyPage from '../Pages/ListHelpToBuyPage';
import ListWithTogetherPage from '../Pages/ListWithTogetherPage';
import ListQuestionAnswerPage from '../Pages/ListQuestionAnswerPage';
import ListGLYJPage from '../Pages/ListGLYJPage';
import ListStrategyPage from './ListStrategyPage';
import SearchFaXianPage from '../Pages/SearchFaXianPage';
import RuralAPIService from "../Commom/RuralAPIService";
import ImageViewer from "./ImageViewer";
import WithTogetherDetails from './WithTogetherDetails';
import Toast from '../Utils/toast';
import StrategyDetailPage from '../Components/StrategyDetailPage';
import RegisteredContainer from '../Containers/RegisteredContainer';
import DateUtil from "../Commom/DateUtil";
export default class FaXianPage extends Component {
    constructor(props) {
        super(props);
        var dataSourceData = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
        this. state = {
            dataSourceList: dataSourceData,
            label:'',
            aboutWithImage:[{image:require('../../Image/new/image_01.png')},
                {image:require('../../Image/new/image_02.png')},
                {image:require('../../Image/new/image_03.png')}],
            isShow:false,
            rotateValue: new Animated.Value(0),//旋转角度的初始值
            data:[{type:1},{type:2},{type:3},{type:4},{type:5},{type:1},{type:2},{type:3},{type:4},{type:1},{type:5},{type:2},{type:3},{type:4}],
            record_count:1,
            page: 1,
            dataList:[],
            isRefreshing:false

        }
    }

    componentDidMount() {
        this.state.rotateValue.setValue(0);
        RuralAPIService.HotLabels().then((ret)=> {
            this.setState({
                label:ret.label,
            })
        }).catch((err)=> {
        });
        this.onRefreshData();
    }
    onRefreshData(){
        RuralAPIService.IndexList('',1).then((ret)=> {
            this.setState({
                dataList:ret.result,
                page:ret.page,
                record_count:ret.record_count,
                isRefreshing: false,
            })
        }).catch((err)=> {
        });
    }
    loadMoreData(){
        if (this.state.page < this.state.record_count) {
            this.setState({
                isRefreshing: true,
            });
            RuralAPIService.IndexList('',this.state.page + 1).then((ret)=> {
                this.setState({
                    dataList:this.state.dataList.concat(ret.result),
                    page:ret.page,
                    record_count:ret.record_count,
                    isRefreshing: false,
                })
            }).catch((err)=> {
            });
        } else {
            if (this.state.page != 1) {
                Toast.show('木有更多数据');
            }
        }
    }
    viewPagerItemClick(images){
        this.props.navigator.push({
            name: 'ImageViewer',
            component: ImageViewer,
            passProps: {
                source: images,
            }
        })
    }
    goHelpToBuy(id){
        this.props.navigator.push({
            id: 'HelpToBuyDetails',
            component: HelpToBuyDetails,
            passProps: {
                ID:id
            }
        });
    }
    goAboutWith(id){
        this.props.navigator.push({
            id: 'WithTogetherDetails',
            component: WithTogetherDetails,
            passProps: {
                ID:id
            }
        });
    }
    travelDetail(id){
        this.props.navigator.push({
            id: 'TravelsDetails',
            component: TravelsDetails,
            passProps: {
                ID:id
            }
        });
    }
    goQA(id){
        this.props.navigator.push({
            id: 'QuestionDetailsPage',
            component: QuestionDetailsPage,
            passProps: {
                ID:id
            }
        });
    }
    goStrategyPage(id){
        this.props.navigator.push({
            id: 'StrategyDetailPage',
            component: StrategyDetailPage,
            passProps: {
                ID:id
            }
        });
    }
    labelBackGroundColor(index){
        var color='';
        switch (index){
            case 0:
                color='#F8F2FF';
                break;
            case 1:
                color='#E6E6FC';
                break;
            case 2:
                color='#FDEDF1';
                break;
            case 3:
                color='#FFF7EE';
                break;
            case 4:
                color='#FDEDF1';
                break;
            case 5:
                color='#FFF7EE';
                break;
            case 6:
                color='#EBFBF0';
                break;
            case 7:
                color='#E6E6FC';
                break;

        }
        return color;
    }
    showBotton(){
        if(this.state.isShow){
            this.showView && this.showView.hideBottomView();
            Animated.timing(this.state.rotateValue,{
                toValue: 0,
                duration: 500,
                easing: Easing.linear
            }).start();// 开始spring动画
        }else{
            this.showView && this.showView.showBottomView();
            Animated.timing(this.state.rotateValue,{
                toValue: 1,
                duration: 500,
                easing: Easing.linear
            }).start();// 开始spring动画
        }
        this.setState({
            isShow:!this.state.isShow
        })
    }
    onClick(id){
        this.showBotton();
        if (Global.Const.token == '') {
            this.props.navigator.push({
                id: 'RegisteredContainer',
                component: RegisteredContainer,
                passProps: {},
            });
            return;
        }
        switch (id){
            case 0:
                this.props.navigator.push({
                    id: 'InitiatedWithTour',
                    component: InitiatedWithTour,
                    passProps: {},
                });
                break;
            case 1:
                this.props.navigator.push({
                    id: 'InitiatedQuestion',
                    component: InitiatedQuestion,
                    passProps: {},
                });
                break;
            case 2:
                this.props.navigator.push({
                    id: 'InitiatedHelpToBuy',
                    component: InitiatedHelpToBuy,
                    passProps: {},
                });
                break;
            case 3:
                this.props.navigator.push({
                    id: 'InitiatedTravels',
                    component: InitiatedTravels,
                    passProps: {},
                });
                break;
        }
    }
    goToDetails(id){
        switch (id){
            case 0:
                break;
            case 1:
                break;
            case 2:
                break;
            case 3:
                break;
            case 4:
                break;
        }

    }
    goList(id){
        switch (id) {
            case 0:
                this.props.navigator.push({
                    id: 'ListHelpToBuyPage',
                    component: ListHelpToBuyPage,
                    passProps: {},
                });
                break;
            case 1:
                this.props.navigator.push({
                    id: 'ListWithTogetherPage',
                    component: ListWithTogetherPage,
                    passProps: {},
                });
                break;
            case 2:
                this.props.navigator.push({
                    id: 'ListGLYJPage',
                    component: ListGLYJPage,
                    passProps: {},
                });
                break;
            case 3:
                this.props.navigator.push({
                    id: 'ListQuestionAnswerPage',
                    component: ListQuestionAnswerPage,
                    passProps: {},
                });
                break;
            case 4:
                this.props.navigator.push({
                    id: 'ListStrategyPage',
                    component: ListStrategyPage,
                });
                break;
        }
    }
    renderHead(){
        {/*header*/}
        return(
            <View>
                <View style={{width:width,height:80,backgroundColor:'white',flexDirection:'row'}}>
                    <TouchableOpacity style={{flex:1}}
                                      activeOpacity={0.5}
                                      onPress={()=>this.goList(0)}>
                        <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                            <Image style={{width:20,height:20,resizeMode:'contain'}}
                                   source={require('../../Image/new/icon_gastronomy_02.png')}/>
                            <Text style={{color:'black',marginTop:8}}>美味佳肴</Text>
                        </View>
                    </TouchableOpacity>
                    <TouchableOpacity style={{flex:1}}
                                      activeOpacity={0.5}
                                      onPress={()=>this.goList(1)}>
                        <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                            <Image style={{width:20,height:20,resizeMode:'contain'}}
                                   source={require('../../Image/new/icon_to_have_fun_02.png')}/>
                            <Text style={{color:'black',marginTop:8}}>自驾约伴</Text>
                        </View>
                    </TouchableOpacity>
                    <TouchableOpacity style={{flex:1}}
                                      activeOpacity={0.5}
                                      onPress={()=>this.goList(2)}>
                        <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                            <Image style={{width:20,height:20,resizeMode:'contain'}}
                                   source={require('../../Image/new/icon_game_02.png')}/>
                            <Text style={{color:'black',marginTop:8}}>攻略游记</Text>
                        </View>
                    </TouchableOpacity>
                    <TouchableOpacity style={{flex:1}}
                                      activeOpacity={0.5}
                                      onPress={()=>this.goList(3)}>
                        <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                            <Image style={{width:20,height:20,resizeMode:'contain'}}
                                   source={require('../../Image/new/icon_ask_02.png')}/>
                            <Text style={{color:'black',marginTop:8}}>你问我答</Text>
                        </View>
                    </TouchableOpacity>
                </View>
                {this.state.label!=''?
                    <View style={{width,backgroundColor:'white',marginTop:10}}>
                    <View style={{width,height:40,justifyContent:'center',alignItems:'center'}}>
                        <Text style={{color:'black'}}>热门标签</Text>
                    </View>
                    <View style={{width:width-20,marginLeft:10,marginBottom:15,flexDirection:'row',flexWrap: 'wrap',justifyContent:'space-around'}}>
                        {this.state.label.map((item, index) => {
                            return(
                                <TouchableOpacity
                                    style={{marginTop:10,height:25}}
                                                  key={index} activeOpacity={0.5}
                                                  onPress={()=>this.goSearchFaXianPage(item)}>
                                <View key={index} style={{backgroundColor: this.labelBackGroundColor(index),borderRadius:3,height:25,alignItems:'center',justifyContent:'center'}}>
                                    <Text style={{color:'black',fontSize:14,marginLeft:5,marginRight:5}}>{item}</Text>
                                </View>
                                </TouchableOpacity>
                            )
                        })}
                    </View>
                </View>:null}
            </View>
        );
    }
    allRow(rowData, sectionId, rowId){
        if(rowData.type_id==2){
            let time = DateUtil.dateStr(rowData.time);
            return(
                <View style={{backgroundColor:'white',marginTop:10}}>
                    <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                        <View style={{flexDirection:'row',alignItems:'center'}}>
                            <Image style={{width:30,height:30,borderRadius:15,marginLeft:10,marginRight:5}}
                                   source={{uri:rowData.author_image}}
                            />
                            <Text >{rowData.author_name}</Text>
                        </View>
                        <Text style={{marginRight:10}}>{time}</Text>
                    </View>
                    <Text numberOfLines={3} style={{marginLeft:10,width:width-20,lineHeight:24,color:'black'}}>{rowData.content}</Text>
                    {rowData.images.length>0?
                        <View style={{width:width-10,marginLeft:5,flexDirection:'row',flexWrap: 'wrap',marginTop:10}}>
                        {rowData.images.map((item, index) => {
                            return(
                                <TouchableOpacity  style={{width:(width-30)/3,height:120,marginLeft:5,marginBottom:5}}  key={'row' + index} onPress={() => this.viewPagerItemClick(rowData.images)}>
                                    <Image
                                        key={'row' + index}
                                        style={{width:(width-30)/3,height:120,resizeMode:'cover'}}  source={{uri:item}}/>
                                </TouchableOpacity>
                            )
                        })}
                    </View>:null}
                    <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                        <View style={{flexDirection:'row',alignItems:'center'}}>
                            <Image style={{width:18,height:18,marginLeft:10,marginRight:8,resizeMode:'contain'}}
                                   source={require('../../Image/new/icon_gastronomy_02.png')}
                            />
                            <Text >帮购</Text>
                        </View>
                        <TouchableOpacity activeOpacity={0.5}
                                          onPress={()=>  this.goHelpToBuy(rowData.id)}>
                                <View style={{width:60,height:24,justifyContent:'center',alignItems:'center',marginRight:10,borderRadius:3,backgroundColor:'#24CD78'}}>
                                    <Text style={{color:'white',fontSize:12}}>帮我买</Text>
                                </View>
                        </TouchableOpacity>
                    </View>
                </View>
            )
        }else if(rowData.type_id==0){
            let time = DateUtil.dateStr(rowData.time);
            return(
                <View style={{backgroundColor:'white',marginTop:10}}>
                <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                    <View style={{flexDirection:'row',alignItems:'center'}}>
                        <Image style={{width:30,height:30,borderRadius:15,marginLeft:10,marginRight:5}}
                               source={{uri:rowData.author_image}}
                        />
                        <Text >{rowData.author_name}</Text>
                    </View>
                    <Text style={{marginRight:10}}>{time}</Text>
                </View>
                <Text numberOfLines={3} style={{marginLeft:10,width:width-20,lineHeight:24,color:'black'}}>{rowData.content}</Text>
                    {rowData.images.length>0?
                        <View style={{width:width-10,marginLeft:5,flexDirection:'row',flexWrap: 'wrap',marginTop:10}}>
                    {rowData.images.map((item, index) => {
                        return(
                            <TouchableOpacity  style={{width:(width-30)/3,height:120,marginLeft:5,marginBottom:5}}  key={'row' + index} onPress={() => this.viewPagerItemClick(rowData.images)}>
                            <Image
                                key={'row' + index}
                                style={{width:(width-30)/3,height:120,resizeMode:'cover'}}  source={{uri:item}}/>
                            </TouchableOpacity>
                        )
                    })}
                </View>:null}
                <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                    <View style={{flexDirection:'row',alignItems:'center'}}>
                        <Image style={{width:18,height:18,marginLeft:10,marginRight:8,resizeMode:'contain'}}
                               source={require('../../Image/new/image_car.png')}
                        />
                        <Text >自驾约伴</Text>
                    </View>
                    <TouchableOpacity activeOpacity={0.5}
                                      onPress={()=>  this.goAboutWith(rowData.id)}>
                        <View style={{width:60,height:24,justifyContent:'center',alignItems:'center',marginRight:10,borderRadius:3,backgroundColor:'#24CD78'}}>
                            <Text style={{color:'white',fontSize:12}}>参加</Text>
                        </View>
                    </TouchableOpacity>
                </View>
            </View>
            )
        }else if(rowData.type_id==3){
            // let time = DateUtil.dateStr(rowData.time);
            // return(
            //     <TouchableOpacity activeOpacity={0.5}
            //                       onPress={()=>  this.travelDetail(rowData.id)}>
            //         <View style={{backgroundColor:'white',marginTop:10}}>
            //             <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white'}}>
            //                 <View style={{flexDirection:'row',alignItems:'center'}}>
            //                     <View style={{width:6,height:6,backgroundColor:'#24CD78',borderRadius:3,marginLeft:10,marginRight:5}}/>
            //                     <Text >游记</Text>
            //                 </View>
            //             </View>
            //                 <View style={{ backgroundColor: 'white',paddingLeft: 10,paddingRight:10,paddingBottom:10,flexDirection: 'row',alignItems: 'center'}}>
            //                     {rowData.images.length>0?
            //                         <Image style={{width:120,height: 90,marginRight: 10,}} source={{uri:rowData.images[0]}}/>:null}
            //                     <View style={{width:width-140,height: 90}}>
            //                         <Text numberOfLines={2} style={{fontSize: 15,color: Global.FontColor.DimGray,lineHeight: 20,height: 45,marginTop:2}}>{rowData.content}</Text>
            //                         <Text numberOfLines={1} style={{position: 'absolute',left:0,bottom:2,fontSize: 13,color: Global.FontColor.LightGrey}}>{time}</Text>
            //                     </View>
            //                 </View>
            //         </View>
            //     </TouchableOpacity>
            // )
            let time = DateUtil.dateStr(rowData.time);
            return(
                <View style={{backgroundColor:'white',marginTop:10}}>
                    <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                        <View style={{flexDirection:'row',alignItems:'center'}}>
                            <Image style={{width:30,height:30,borderRadius:15,marginLeft:10,marginRight:5}}
                                   source={{uri:rowData.author_image}}
                            />
                            <Text >{rowData.author_name}</Text>
                        </View>
                        <Text style={{marginRight:10}}>{time}</Text>
                    </View>
                    <Text numberOfLines={3} style={{marginLeft:10,width:width-20,lineHeight:24,color:'black'}}>{rowData.content}</Text>
                    {rowData.images.length>0?
                        <View style={{width:width-10,marginLeft:5,flexDirection:'row',flexWrap: 'wrap',marginTop:10}}>
                            {rowData.images.map((item, index) => {
                                return(
                                    <TouchableOpacity  style={{width:(width-30)/3,height:120,marginLeft:5,marginBottom:5}}  key={'row' + index} onPress={() => this.viewPagerItemClick(rowData.images)}>
                                        <Image
                                            key={'row' + index}
                                            style={{width:(width-30)/3,height:120,resizeMode:'cover'}}  source={{uri:item}}/>
                                    </TouchableOpacity>
                                )
                            })}
                        </View>:null}
                    <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                        <View style={{flexDirection:'row',alignItems:'center'}}>
                            <Image style={{width:18,height:18,marginLeft:10,marginRight:8,resizeMode:'contain'}}
                                   source={require('../../Image/new/image_car.png')}
                            />
                            <Text >游记</Text>
                        </View>
                        <TouchableOpacity activeOpacity={0.5}
                                          onPress={()=>  this.travelDetail(rowData.id)}>
                            <View style={{width:60,height:24,justifyContent:'center',alignItems:'center',marginRight:10,borderRadius:3,backgroundColor:'#24CD78'}}>
                                <Text style={{color:'white',fontSize:12}}>查看详情</Text>
                            </View>
                        </TouchableOpacity>
                    </View>
                </View>
            )
        }else if(rowData.type_id==1){
            let time = DateUtil.dateStr(rowData.time);
            return(
                <TouchableOpacity activeOpacity={0.5}
                                  onPress={()=>this.goQA(rowData.id)}>
                <View style={{backgroundColor:'white',marginTop:10}}>
                    <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                        <View style={{flexDirection:'row',alignItems:'center'}}>
                            <Image style={{width:30,height:30,borderRadius:15,marginLeft:10,marginRight:5}}
                                   source={{uri:rowData.author_image}}
                            />
                            <Text >{rowData.author_name}</Text>
                        </View>
                        <Text style={{marginRight:10}}>{time}</Text>
                    </View>
                    <Text numberOfLines={3} style={{marginLeft:10,width:width-20,lineHeight:24,color:'black'}}>{rowData.content}
                    </Text>
                    <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white',marginTop:8}}>
                        <View style={{flexDirection:'row',alignItems:'center'}}>
                            <Image style={{width:18,height:18,marginLeft:10,marginRight:8,resizeMode:'contain'}}
                                   source={require('../../Image/new/icon_ask.png')}
                            />
                            <Text >有问必答</Text>
                        </View>
                        <TouchableOpacity activeOpacity={0.5}
                                          onPress={()=>this.goQA(rowData.id)}>
                            <View style={{width:60,height:24,justifyContent:'center',alignItems:'center',marginRight:10,borderRadius:3,backgroundColor:'#F2B94C'}}>
                                <Text style={{color:'white',fontSize:12}}>有赏问答</Text>
                            </View>
                        </TouchableOpacity>
                    </View>
                </View>
                </TouchableOpacity>
            )
        }
        // else if(rowData.type_id==6){
        //     return(
        //         <View style={{backgroundColor:'white',marginTop:10}}>
        //             <View style={{flexDirection:'row',height:55,width,justifyContent:'space-between',alignItems:'center',backgroundColor:'white'}}>
        //                 <View style={{flexDirection:'row',alignItems:'center'}}>
        //                     <View style={{width:6,height:6,backgroundColor:'#24CD78',borderRadius:3,marginLeft:10,marginRight:5}}/>
        //                     <Text >推荐攻略</Text>
        //                 </View>
        //                 <TouchableOpacity activeOpacity={0.5}
        //                                   onPress={()=>this.goList(4)}>
        //                     <View style={{flexDirection:'row',alignItems:'center'}}>
        //                         <Text style={{marginBottom:1}}>更多</Text>
        //                         <Image style={{width:10,height:13,resizeMode:'contain',marginLeft:5,marginRight:8}}
        //                         source={require('../../Image/icon_go.png')}/>
        //                     </View>
        //                 </TouchableOpacity>
        //             </View>
        //             <TouchableOpacity activeOpacity={0.5}
        //                               onPress={()=>this.goStrategyPage(rowData.id)}>
        //                 <View style={{width:width-20,height:180,marginLeft:10,borderRadius:5,marginBottom:5}}>
        //                     <Image style={{width:width-20,height:180,resizeMode:'cover',borderRadius:5}}
        //                            source={{uri:rowData.image}}/>
        //                     <View style={{position: 'absolute',left:0,bottom:0,backgroundColor:'rgba(0,0,0,0.5)',width:width-20,height:30,justifyContent:'center',borderBottomLeftRadius:5,borderBottomRightRadius:5}}>
        //                         <Text style={{color:'white',marginLeft:8}}>{rowData.title}</Text>
        //                     </View>
        //                 </View>
        //             </TouchableOpacity>
        //         </View>
        //     )
        // }
        else{
            return null;
        }
    }
    goSearchFaXianPage(search){
        this.props.navigator.push({
            id: 'SearchFaXianPage',
            component: SearchFaXianPage,
            passProps: {
                search:search
            }
        });
    }
    renderFooter(){
        return(
            <View style={{width,height:80,backgroundColor:null}}/>
        )
    }
    render() {
        return (
            <View style={styles.container}>
                <View style={{width,height:64,backgroundColor:'#24CD78',flexDirection:'row',justifyContent:'space-between',paddingTop:20,alignItems:'center'}}>
                    <View style={{flexDirection:'row',width:40,height:40,marginLeft:10,alignItems:'center',}}>
                    </View>
                    <Text style={{color:'white',fontSize:19}}>发现</Text>
                    <TouchableOpacity activeOpacity={0.5}
                                      onPress={()=>this.goSearchFaXianPage('')}>
                        <View style={{flexDirection:'row',width:40,height:40,marginRight:10,justifyContent:'flex-end',alignItems:'center'}}>
                            <Image style={{width:17,height:17,resizeMode:'contain',marginLeft:8}}
                                   source={require('../../Image/new/icon_search.png')}/>
                        </View>
                    </TouchableOpacity>
                </View>
                <ListView
                    refreshControl={
                        <RefreshControl
                            refreshing={this.state.isRefreshing}
                            onRefresh={() => {this.onRefreshData()}}
                            colors={['#4CAF50', '#4CAF50', '#4CAF50', '#4CAF50']}
                            progressBackgroundColor="white"
                        /> }
                    onEndReached={() => {this.loadMoreData()}}
                    renderHeader={()=> this.renderHead()}
                    renderFooter={()=> this.renderFooter()}
                    enableEmptySections={true}
                    dataSource={this.state.dataSourceList.cloneWithRows(this.state.dataList)}
                    renderRow={(rowData, sectionId, rowId) => this.allRow(rowData, sectionId, rowId)}/>
                {this.state.isShow?<View style={{width,height,backgroundColor: 'rgba(0,0,0,0.3)', position: 'absolute',top: 0,left: 0}}/>:null}
                <TouchableOpacity style={{position: 'absolute',right:10,bottom:10,width:65,height:65}}
                                  activeOpacity={0.5}
                                  onPress={()=>this.showBotton()}>
                    <Animated.Image source={require('../../Image/new/icon_add.png')}
                                    style={{width:65,
                                        height: 65,resizeMode:'cover',
                                        transform: [
                                            {rotateZ: this.state.rotateValue.interpolate({
                                                inputRange: [0,1],
                                                outputRange: ['0deg', '45deg'],
                                            })},
                                        ]}}>
                    </Animated.Image>
                </TouchableOpacity>
                <ShowView ref={(ref)=>{this.showView=ref}}
                          onClick={(id)=>this.onClick(id)}
                />
            </View>
        );
    }
}
const styles = StyleSheet.create({
    container: {
        flex:1,
        backgroundColor: Global.Const.transparent,
    },
});

